package com.practise.beanconf.xml;

import com.practise.beanconf.xml.model.People;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.support.ClassPathXmlApplicationContext;

@SpringBootApplication
@Slf4j
public class App implements ApplicationRunner {
    public static void main(String[] args) {
        SpringApplication.run(App.class);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"});
        People pepole = context.getBean("xmlPepole",People.class);
        log.info("pepole bean from xml config file is : {}",pepole.toString());
    }
}
